<#if authority.is(4,"3") >
<div id="rolemod" align="center">
<form name="rolemod_form" id="rolemod_form">
<input type="hidden" name="scid" value="auth_4">
<input type="hidden" name="roleid" id="roleid" >
<table width="400px" height="100px">
	<tr>
		<td>角色</td>
		<td><input id="name" type="text" name="name" maxlength="20"  value="" /></td>
	</tr>
	<tr>
		<td>说明</td>
		<td><input id="note" type="text" name="note"  value="" /></td>
	</tr>
	<tr collspan="2">
		<td width="78px" height="30px"><input name="bsubmit" id="bsubmit" type="button" value="提交" /><div id="submiting"></div></td>	
	</tr>
</table>
</form>
</div>


<script type="text/javascript">
var dataURL = '/data/sc.action';//取数据的url
var dataURLParams = {"scid":"auth_3","id":item_value};//要传给dataURL的参数
var mainPanel = 'mainPanel';

var fillcontent = function(){
try {
	var request = new Request.JSON({
		url: dataURL,
		onComplete: function(json,text) {
			 if(null != json.recorders && json.recorders.length>0){
					$('name').set('value',json.recorders[0].name);
					$('note').set('value',json.recorders[0].note);
				}else{
					MUI.notification('<font color=red>错误：</font>未取到角色信息, id = '+item_value);
				}
		}
	}).get(dataURLParams);
	} catch (ex) {
		$('submiting').innerHTML='';
		MUI.notification('<font color=red>错误：</font>访问失败('+ex.message+')');
		$('bsubmit').setStyle('display','block');
	}
}

 window.addEvent('domready', function() {
 	fillcontent();
	$('bsubmit').addEvent('click', function(e){
		$('rolemod_form').set('send', {
    		url: dataURL, 
    		onSuccess:function(responseText, responseXML){
    			//alert(responseText);
    			$('bsubmit').set('disabled', false);
    			$('submiting').innerHTML = '';
    			var myjson = JSON.decode(responseText);
    			if (myjson.error.errorcode==0){
    				MUI.notification('修改成功！');
    				MUI.updateContent({
						'element':  $(mainPanel),
						'url':      '/auth/roles.action'
					});
    			}else{
    				MUI.notification('<font color=red>错误：</font>('+myjson.error.retstring+')');
    				
    			}
    		},
    		onFailure:function(instance){
    			MUI.notification('<font color=red>错误：</font>访问失败('+instance+')');
    			$('bsubmit').set('disabled', false);
    			$('submiting').innerHTML = '';
    		}
		});
		$('bsubmit').set('disabled', true);
		$('roleid').set('value',item_value);
		$('submiting').innerHTML = '<img src="images/spinner.gif" width="16px" height="16px">';
		$('rolemod_form').send();
	});

 
 });
</script>
<#else>
您无权访问该页面！
</#if>